<script type="text/javascript">
    $(function(){
        $("a.add").button({
            icons: {
                primary: "ui-icon-plusthick"
            }
        });
        $("#list-table").tablesorter({
            headers: {
                3: { 
                    sorter: false 
                }
            } 
        });
    })
</script>
<?php $count = $category->getNominees()->count();
    if($count): ?>
    <div id="list" class="span-24">
        <table id="list-table" class="tablesorter">
            <thead>
                <tr>
                    <th>Nombre</th>
                    <th>Descripción</th>
                    <th>Votos</th>
                    <th>Acciones</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($category->getNominees() as $candidate): ?>
                    <tr>
                        <td class="span-5">
                            <a href="<?php echo url_for('candidate_show', $candidate) ?>"><?php echo $candidate->getName() ?></a>
                        </td>
                        <td class="span-15"><?php echo $candidate->getDescription() ?></td>
                        <td class="span-1"><?php echo $candidate->getActive() ? 
                                '<span class="ui-icon ui-icon-check"></span>' : '<span class="ui-icon ui-icon-closethick"></span>' ?></td>
                        <td class="span-3 last"> 
                            <a class="show-icon-only" href="<?php echo url_for('candidate_show', $candidate) ?>"><?php echo $candidate->getName() ?></a>
                            <a class="edit-icon-only" href="<?php echo url_for('candidate_edit', $candidate) ?>"><?php echo $candidate->getName() ?></a>
                        </td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
<?php else : ?>
    <div class="span-24">
        <p><h2>No hay nominados para esta categoria.</h2></p>
    </div>
<?php endif; ?>
<?php if($count < 5): ?>
<hr>
&nbsp;<a class="add" href="<?php echo url_for('category_add_nominee', $category) ?>">Nuevo Nominado</a>
<?php endif; ?>

